import { request } from 'umi';

export interface StateType {
    status?: 'ok' | 'error';
    currentAuthority?: 'user' | 'guest' | 'admin';
}

export interface UserRegisterParams {
    account: string;
    password: string;
    confirm: string;
    phone: string;
    captcha: string;
    prefix: string;
}

export async function fakeRegister(params: UserRegisterParams) {
    return request('/api/auth/reg', {
        method: 'POST',
        data: params,
    });
}

export async function getCode(params: any) {
    return request('/api/auth/getVerifyCode', {
        method: 'POST',
        data: params,
    });
}

export async function loginMent(params: any) {
    return request('/api/auth/login', {
        method: 'POST',
        data: params,
    });
}

export async function getAccessToken(params: any) {
    return request('/api/auth/wx/getAccessToken', {
        method: 'POST',
        data: params,
    });
}
export async function bindUserPhone(params: any) {
    return request('/api/auth/wx/bindUserPhone', {
        method: 'POST',
        data: params,
    });
}
export async function getBindUser(params: any) {
    return request('/api/auth/wx/getBindUser', {
        method: 'POST',
        data: params,
    });
}

